package com.gxnu.edu.cn.ttxxt.service;

import com.gxnu.edu.cn.ttxxt.entity.ChatGroups;
import com.gxnu.edu.cn.ttxxt.entity.GroupsMembers;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface GroupService {

    ChatGroups createGroup(Long creatorId, String groupName, String description);

    void addMember(Long groupId, Long userId, Integer role);

    void removeMember(Long groupId, Long userId);

    void updateMemberRole(Long groupId, Long userId, Integer role);

    @Transactional
    void transferOwnership(Long groupId, Long currentOwnerId, Long newOwnerId);

    void dissolveGroup(Long groupId, Long operatorId);

    List<ChatGroups> getUserGroups(Long userId);

    List<GroupsMembers> getGroupMembers(Long groupId);

    List<GroupsMembers> getGroupAdmins(Long groupId);

    ChatGroups getGroupInfo(Long groupId);

    ChatGroups dissolveGroupName(String groupName, Long operatorId);

    List<ChatGroups> getUserJoinGroups(Long userId);

    void applyToJoinGroup(Long userId, Long groupId, String message);
}
    